using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Castle.MicroKernel;

namespace NDomain.ExampleModels.BloggingSystem.Infrastructure
{
    public static class IoCHelper
    {
        public static void InjectDependencies(object obj, IKernel container)
        {
            foreach (FieldInfo field in ReflectionHelper.GetFields(obj))
                if (container.HasComponent(field.FieldType))
                    field.SetValue(obj, container[field.FieldType]);
        }
    }
}
